package cn.hdu.liang.arrays;

import java.util.Arrays;

class A {
    String name;
    int age;

    public A(String name, int age) {
        this.name = name;
        this.age = age;
    }

    @Override
    public String toString() {
        return "A{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}


public class FillingArrays {
    public static void main(String[] args) {
        int size = 6;
        String[] a = new String[size];
        Arrays.fill(a, "Hello");
        System.out.println(Arrays.toString(a));
        Arrays.fill(a, 3, 5, "World");
        System.out.println(Arrays.toString(a));
        a[3] = "liang";
        System.out.println(Arrays.toString(a));
    }
}
